/*   1:    */ package com.atomikos.icatch.imp;
/*   2:    */ 
/*   3:    */ import com.atomikos.icatch.CompositeCoordinator;
/*   4:    */ import com.atomikos.icatch.CompositeTransaction;
/*   5:    */ import com.atomikos.icatch.Propagation;
/*   6:    */ import com.atomikos.icatch.RecoveryCoordinator;
/*   7:    */ import java.util.Stack;
/*   8:    */ 
/*   9:    */ public class PropagationImp
/*  10:    */   implements Propagation
/*  11:    */ {
/*  12:    */   private Stack lineage_;
/*  13:    */   private boolean serial_;
/*  14:    */   private long timeout_;
/*  15:    */   
/*  16:    */   public static Propagation adaptPropagation(Propagation propagation, RecoveryCoordinator adaptor)
/*  17:    */   {
/*  18: 59 */     Stack lineage = propagation.getLineage();
/*  19:    */     
/*  20:    */ 
/*  21: 62 */     CompositeTransaction remote = (CompositeTransaction)lineage.peek();
/*  22: 63 */     CompositeTransaction ct = new CompositeTransactionAdaptor(lineage, remote.getTid(), remote.isSerial(), adaptor, remote.getCompositeCoordinator().isRecoverableWhileActive());
/*  23:    */     
/*  24:    */ 
/*  25: 66 */     lineage.pop();
/*  26:    */     
/*  27:    */ 
/*  28: 69 */     lineage.push(ct);
/*  29:    */     
/*  30: 71 */     return new PropagationImp(lineage, propagation.isSerial(), propagation.getTimeOut());
/*  31:    */   }
/*  32:    */   
/*  33:    */   public PropagationImp(Stack lineage, boolean serial, long timeout)
/*  34:    */   {
/*  35: 96 */     this.serial_ = serial;
/*  36: 97 */     this.lineage_ = ((Stack)lineage.clone());
/*  37: 98 */     this.timeout_ = timeout;
/*  38:    */   }
/*  39:    */   
/*  40:    */   public Stack getLineage()
/*  41:    */   {
/*  42:107 */     return this.lineage_;
/*  43:    */   }
/*  44:    */   
/*  45:    */   public boolean isSerial()
/*  46:    */   {
/*  47:116 */     return this.serial_;
/*  48:    */   }
/*  49:    */   
/*  50:    */   public long getTimeOut()
/*  51:    */   {
/*  52:125 */     return this.timeout_;
/*  53:    */   }
/*  54:    */   
/*  55:    */   public boolean equals(Object o)
/*  56:    */   {
/*  57:133 */     boolean ret = false;
/*  58:134 */     if ((o instanceof PropagationImp))
/*  59:    */     {
/*  60:135 */       PropagationImp other = (PropagationImp)o;
/*  61:136 */       CompositeTransaction otherCt = (CompositeTransaction)other.lineage_.peek();
/*  62:    */       
/*  63:138 */       CompositeTransaction ct = (CompositeTransaction)this.lineage_.peek();
/*  64:    */       
/*  65:    */ 
/*  66:    */ 
/*  67:142 */       ret = ct.isSameTransaction(otherCt);
/*  68:    */     }
/*  69:144 */     return ret;
/*  70:    */   }
/*  71:    */   
/*  72:    */   public int hashCode()
/*  73:    */   {
/*  74:153 */     int ret = 0;
/*  75:    */     
/*  76:155 */     CompositeTransaction ct = (CompositeTransaction)this.lineage_.peek();
/*  77:156 */     ret = ct.getTid().hashCode();
/*  78:    */     
/*  79:158 */     return ret;
/*  80:    */   }
/*  81:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions\3.7.0\transactions-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.imp.PropagationImp
 * JD-Core Version:    0.7.0.1
 */